package net.magicalcloud.magicalcloud.model;

import net.magicalcloud.magicalcloud.entity.Files;
import net.magicalcloud.magicalcloud.entity.RestJson;
import net.magicalcloud.magicalcloud.entity.Shares;
import net.magicalcloud.magicalcloud.entity.User;

import java.util.List;
import java.util.Map;

import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Response;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.PartMap;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;

/**
 * Created by Pei on 2018/6/6.
 */

public interface AppURL {


    /*  网址
    *   https://www.jianshu.com/p/a8b88c7fe831
    * */


    @GET("user/checkUser")
    Call<RestJson<User>> findUserByEmail(@Query("e")String email, @Query("p") String password);


    //显示回收站
    @GET("files/ADshowRecycle")
    Call<RestJson<List<Files>>> showRecycle(@Query("u")int userId);

    //显示所有分享
    @GET("shares/ADselectAllShares")
    Call<RestJson<List<Shares>>> showMyShares(@Query("userId")int userId);


    @POST("files/ADvagueSearchFile")
    Call<RestJson<List<Files>>> vagueSearch(@Query("value") String value, @Query("userId")int userId);


    @POST("files/ADfindSubfile")
    Call<RestJson<List<Files>>> findSubfiles(@Query("folderId") String folderId);

    @Multipart
    @POST("files/AnUploadFiles")
    Call<RestJson<Files>> uploadFiles(@QueryMap Map<String,String> options, @PartMap Map<String, RequestBody> params);
}
